package com.xbongbong.pro.domain.dao;

import com.xbongbong.pro.domain.entity.LinkProductRelyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @description: 关联产品数据联动
 * @Author: hongxiao
 * @date: 2019-03-02 17:43
 * @since v1.0
 */
@Repository
@Mapper
public interface LinkProductRelyDao {

    Integer insert(LinkProductRelyEntity linkProductRelyEntity);

    Integer update(LinkProductRelyEntity linkProductRelyEntity);

    Integer deleteByKey(@Param("key") Long key);

    List<LinkProductRelyEntity> findEntitys(@Param("param") Map<String, Object> param);

    List<LinkProductRelyEntity> getByFormId(@Param("corpid")String corpid,@Param("formId")Long formId, @Param("del")Integer del);

    Integer insertBatch(@Param("list") List<LinkProductRelyEntity> linkProductRelyEntityList);

    Integer updateBatch(@Param("list") List<LinkProductRelyEntity> linkProductRelyEntityList);

    List<LinkProductRelyEntity> getByFormIdAndLinkFormId(@Param("corpid")String corpid, @Param("formId")Long formId, @Param("sourceFormId")Long linkFormId, @Param("del")Integer del);

    LinkProductRelyEntity getByAttrAndFormIdAndLinkFormId(@Param("corpid")String corpid, @Param("attr") String attr, @Param("formId")Long formId, @Param("sourceFormId")Long linkFormId, @Param("del")Integer del);

    LinkProductRelyEntity getByAttrAndFormIdAndSourceBusinessType(@Param("corpid")String corpid, @Param("attr") String attr, @Param("formId")Long formId, @Param("sourceBusinessType")Integer sourceBusinessType, @Param("del")Integer del);
}
